   //设置宽度
   $(".add_to_more").on("click",function(){
   		$(".multi-screen").removeClass("multi-screen-little").show();
   		var item_len=$(".multi-screen-item").length;
   		if(0<=item_len && item_len<9){
   			if(1<=item_len && item_len<4){
   			$(".multi-screen").css("width",""+1208+"px").removeClass("multi-screen-line-2-items").removeClass("multi-screen-line-3-items").addClass("multi-screen-line-2-items");
   			
	   		}
	   		
	   		else if(item_len>=4 && item_len<9){
	   			if(item_len==4){
	   				$(".friendly-notice").show();
	   			}
	   			$(".multi-screen").removeClass("multi-screen-line-2-items").addClass("multi-screen-line-3-items");
	   			
	   		}
   			$(".multi-screen-list").append('<div class="multi-screen-item" data-id="609423"><div class="multi-screen-item-wrap"><span class="multi-screen-video-close">×</span> <img src="http://i7.pdim.gs/45/886ea836ac5058c0d36c57664a9e121c/w338/h190.jpg" alt="萌兽秋田犬"><video autoplay class="multi-screen-item-video" width="100%" height="100%" src="blob:http://www.panda.tv/73702b85-3c90-449d-8a86-d1cd0651c869"></video><span class="multi-screen-item-tag multi-screen-item-tag-playing">直播</span> <a class="multi-screen-video-enter" href="/609423">进入直播间</a><div class="multi-screen-video-controller"><span class="multi-screen-video-icon multi-screen-video-volume"></span> <span class="multi-screen-video-icon multi-screen-video-play"></span></div></div></div>')

   		}
   		
   		else if(item_len>=9){
   			$(".multi-screen-error-msg").show();
   			console.log($(".multi-screen-item").length);


   		}
         $(".multi-screen-little-btn").hide();
   		setheight();
   		opertateVideo();
   });

    //设置位置
   var _w=$(".multi-screen").width();
   var _h=$(".multi-screen").height();
   $(".multi-screen").css({"position":"fixed","margin-bottom":""+(-_h/2)+"px","margin-left":""+(-_w/2)+"px"});
   
   //可拖拽，可伸缩
   $("#ui-resizable").resizable({
   		stop: function(event, ui) {
   			setheight();			
   		}
   });
   $(".ui-draggable").draggable({
   		drag: function(event, ui) {
   				setheight();	
   		}
   });
   //设置高度
   function setheight(){
   			var multi_screen_h=$(".multi-screen").height();
   			var multi_screen_w=$(".multi-screen").width();
   			var multi_screen_list_h=$(".multi-screen-list").height();
   			var multi_screen_list_w=$(".multi-screen-list").width();
   			
   			$(".multi-screen").height(multi_screen_list_h+37);  
   			// $(".multi-screen").width(multi_screen_list_w+2);  	
   }

   function opertateVideo(){
   		$(".multi-screen-video-volume").on("click",function(){
            var _this=$(this);
   			if(_this.hasClass("multi-screen-video-no-volume")) {
   				_this.removeClass("multi-screen-video-no-volume"); 				

   			}
   			else{
   				_this.addClass("multi-screen-video-no-volume");
               console.log("volume");
   			}
   		})
   		
   		$(".multi-screen-video-close").on("click",function(){
            
   			$(this).closest(".multi-screen-item").remove();
            var item_len=$(".multi-screen-item").length;
            if(item_len==1){
                $(".multi-screen").css("width",""+600+"px").removeClass("multi-screen-line-2-items").removeClass("multi-screen-line-3-items");
            }
            else if(1<item_len && item_len<5){
            $(".multi-screen").css("width",""+1208+"px").removeClass("multi-screen-line-3-items").addClass("multi-screen-line-2-items");
            console.log(item_len)
            
            }
            
            else if(item_len>=5 && item_len<9){
               
               $(".multi-screen").removeClass("multi-screen-line-2-items").addClass("multi-screen-line-3-items");
               
            }
            else if(item_len<1){
               $(".multi-screen").removeClass("multi-screen-little").addClass("multi-screen-little");
               console.log("ok");
               setTimeout(function(){
                 
                  $(".multi-screen").css("display","none")
               },500)
               $(".multi-screen-little-btn").hide();
            }
               
   			setheight();
   		})

   		$(".friendly-notice .friendly-notice-btn-ok").on("click",function(){
   			$(".friendly-notice").hide();
   		})

   		$(".multi-screen-error-msg .friendly-notice-btn-ok").on("click",function(){
   			$(".multi-screen-error-msg").hide();
   		})
   		
   }
   //关闭一屏多看打开小按钮
   function close(){
		$(".multi-screen-close").on("click",function(){
			$(".multi-screen").removeClass("multi-screen-little").addClass("multi-screen-little");
			console.log("ok");
			setTimeout(function(){
				$(".multi-screen-little-btn").css("display","block");
				$(".multi-screen").css("display","none")
			},500)
		})
		$(".multi-screen-little-btn").on("click",function(){
			$(".multi-screen").removeClass("multi-screen-little").show();
			
				$(".multi-screen-little-btn").css("display","none")
			
		})

   }
   close();